package com.eastedu.model.permission.common;

import com.google.common.collect.Lists;
import lombok.Getter;

import java.util.List;

/**
 * 〈资源类型〉
 *
 * @author ZHISHUAI.ZHANG
 */
@Getter
public enum ResourceTypeEnum {

    /**
     * 资源权限类型
     */
    OTHERS("OTHERS", "其他", false),
    PREPARATION("3", "备课包", false),
    ASSIGNMENT("0", "电子作业", true),
    QUESTION("1", "试题", false),
    PREVIEW("2", "预习单", true),
    COURSEWARE("4", "教学课件", true),
    MATERIAL("5", "素材", false),
    PAPER("6", "电子试卷", true),
    MICRO_COURSE("7", "微课", false),
    MODEL_LESSON("8", "示范课", true),
    CLASS_MEMOIR("9", "备课实录", false),
    GENERAL_MEMOIR("10", "普通实录", true),
    TEACHING_CASE("11", "教案", true),
    ORDINARY_HOMEWORK("12", "普通作业", false),
    GENERAL_PAPER("13", "普通试卷", false),
    STRUCTURE_PREPARATION("14", "结构化备课包", false),
    COURSE("15", "课程", false),
    STRUCTURE_COURSEWARE("16", "结构化课件", false),
    TEACHING_RESEARCH_RECORD("19", "教研实录", false),
    TEACHING_RESEARCH_WARE("22", "教研课件", true),
    PREPARE_LESSON_WARE("20", "备课课件", true),
    NOTICE("25", "公告", false),
    SUMMARY("26", "备课纪要", false),
    DOCUMENT("27", "备课文稿", false),
    ACTIVITY_RECORD("28", "活动实录", false),
    ACTIVITY_PLAN("29", "活动方案", true),
    STUDENT_SAMPLE("30", "学生范例", true),
    EXTRACURRICULAR_EXTENSION("31", "课外拓展", true),
    THEME_LESSON("33", "主题课", false),
    ;

    private final String code;
    private final String name;

    ResourceTypeEnum(String code, String name, boolean download) {
        this.code = code;
        this.name = name;
    }

    public static List<ResourceTypeEnum> sortedResourceTypes() {
        return Lists.newArrayList(
                PREVIEW,
                PREPARATION,
                TEACHING_CASE,
                COURSEWARE,
                MATERIAL,
                ASSIGNMENT,
                PAPER,
                QUESTION,
                MICRO_COURSE,
                MODEL_LESSON,
                GENERAL_MEMOIR,
                CLASS_MEMOIR,
                PREPARE_LESSON_WARE,
                TEACHING_RESEARCH_WARE,
                COURSE,
                NOTICE,
                TEACHING_RESEARCH_RECORD,
                ACTIVITY_RECORD,
                ACTIVITY_PLAN,
                STUDENT_SAMPLE,
                EXTRACURRICULAR_EXTENSION,
                THEME_LESSON,
                STRUCTURE_PREPARATION,
                STRUCTURE_COURSEWARE);
    }
}
